﻿using FDStudio.Core.Entities;
using FDStudio.Core.Entities.Query;
using System;
using System.Linq.Expressions;

namespace FDStudio.Core.Repositories
{
    /*
     CreatedOn: 2018-01-26
     CreatedBy: Jackie Lee(天宇遊龍)
     */
    /// <summary>
    /// 只读仓储
    /// </summary>
    /// <typeparam name="T"></typeparam>
    public abstract class PagedReadRepository<T> : ReadOnlyRepository<T>, IPagedReadRepository<T> where T : class, IEntity
    {
        public PagedList<T> GetList(Expression<Func<T, bool>> condition, long pageIndex, long pageSize, IQueryOrder<T> orderBy)
        {
            return RepositoryContext<IReadOnlyRepositoryContext>().GetList(condition, pageIndex, pageSize, orderBy);
        }
    }
}
